package yxy.game.pm2.active.module.actdata;

import yxy.cherry.data.actdata.DataCenterAct;
import yxy.game.pm2.bean.area.AreaBean;
import yxy.game.pm2.bean.module.AreaModule;

import java.util.Map;

/**
 * 活动数据处理  
 * @author Dell
 *
 */
public class ActDataCenter {

	static private ActDataCenter instance;

	public static ActDataCenter getInstance() {
		return instance;
	}

	private ActDataCenter() {
		
	}

	synchronized static public <T> T getData(int id, Class<T> clazz, String playerCode) {
		AreaBean ab = AreaModule.area(playerCode);
		return DataCenterAct.getData(id, clazz, ab.getAreaId());
	}
	
	synchronized static public <T> T getData(int id, Class<T> clazz, int areaid) {
		return DataCenterAct.getData(id, clazz, areaid);
	}

	synchronized static public <T> T getData(String code, Class<T> clazz, int areaid) {
		return DataCenterAct.getData(code, clazz, areaid);
	}

	synchronized static public <T> Map<String, T> getAllData(Class<T> clazz, String playerCode) {
		AreaBean ab = AreaModule.area(playerCode);
		return DataCenterAct.getAllData(clazz, ab.getAreaId());
	}
	
	synchronized static public <T> Map<String, T> getAllData(Class<T> clazz, int areaid) {
		return DataCenterAct.getAllData(clazz, areaid);
	}

}
